/*
*Copyright (c) Nikhil Jain.
*Project ICARUS, communications and 
*artificial intelligence.
*/



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package javadrone.statedata;

//~--- non-JDK imports --------------------------------------------------------

import javadrone.Sensor;

//~--- JDK imports ------------------------------------------------------------

import java.io.Serializable;

/**
 *
 * @author Nikzzay
 * install in both client and server
 */
public class ErrorData extends StateData<ErrorData.ErrorState> {
    private static final Sensor DESCRIPTOR = Sensor.ERROR_STATE;

    public ErrorData(ErrorState ns) {
        super(ns, DESCRIPTOR);
    }

    @Override
    public String toString() {
        return "ERROR DATA: " + getData().toString();
    }

    public static class ErrorState implements Serializable {
        ErrorFlag errorFlag;

        public enum ErrorFlag {
            BOOT_ERROR, BOOT_PACKAGE_ERROR, BOOT_NOT_READY_ERROR, CAM_ERROR, EMPTY_COMMAND_QUEUE_ERROR,
            CONNECTION_ERROR, IMAGE_READ_ERROR
        }

        public ErrorState(ErrorFlag errorFlag) {
            this.errorFlag = errorFlag;
        }

        public ErrorFlag hasBooted() {
            return errorFlag;
        }

        @Override
        public String toString() {
            return "ERROR STATE: " + errorFlag;
        }
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
